<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="/demo/upload/css/font-awesome.min.css">
    <link rel="stylesheet" href="//cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.6.1/css/bootstrap.min.css">
    <link rel="stylesheet" href="//cdn.bootcdn.net/ajax/libs/toastr.js/latest/toastr.min.css">
    <script src="//libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <script src="//cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.6.1/css/bootstrap.min.css"></script>
    <script src="//cdn.bootcdn.net/ajax/libs/toastr.js/latest/toastr.min.js"></script>
    <script src="/demo/upload/js/upload.js"></script>

    <style>
        html, body{height: 100%;}
        #file {display: none;}
        .row {margin: 0;}
        .uploaded {margin: auto auto;}
        .uploading {display: none; margin: auto 0;}
    </style>
</head>
<body>

<input type="file" id="file" onchange="init()">
<div style="height:45%"></div>
<div class="row" style="height:10%">
    <button class="btn btn-primary col-md-2 offset-md-5 uploaded" onclick="selectFile()">选择文件</button>
    <!-- 点击选择文件按钮后隐藏uploaded，显示uploading -->
    <span id="fileName" class="col-md-3 text-center uploading">文件名</span>
    <div class="progress col-md-6 uploading">
        <div id="progress-bar" class="progress-bar progress-bar-striped progress-bar-animated"></div>
    </div>
    <span id="fileSize" class="col-md-2 text-center uploading">大小</span>
    <button class="close col-md-1 uploading" onclick="closeProgressBar()">&times;</button>
</div>
<div style="height:45%"></div>

</body>
</html>